﻿<%@ Page Title="" Language="C#" MasterPageFile="~/back/Site.master" AutoEventWireup="true"
    CodeFile="~/back/AddContent.aspx.cs" Inherits="back_AddContent" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('.cleditor').cleditor();

            $('#MainContent_txtPageName').bind('keypress', function (event) {
                if (event.keyCode != 8) {
                    var regex = new RegExp("^[a-zA-Z0-9]*$");
                    var InputValue = String.fromCharCode(!event.keyCode ? event.which : event.keyCode);
                    var key = $(this).val();
                    key = key + InputValue;
                    if (!regex.test(key)) {
                        event.preventDefault();
                        return false;
                    }
                }
            });
        });
    </script>
    <div class="page-header">
        <h1>
            Add Page Content</h1>
    </div>
    <div id="divMessage" runat="server">
    </div>
    <div class="control-group">
        <label class="control-label">
            Page Title</label>
        <div class="controls">
            <asp:TextBox ID="txtPageTitle" runat="server" CssClass="input-xlarge"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvPageTitle" runat="server" CssClass="alert-error"
                ErrorMessage="Please enter page title" ControlToValidate="txtPageTitle" ValidationGroup="Content"
                Display="Dynamic"></asp:RequiredFieldValidator>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">
            Page Name</label>
        <div class="controls">
            <asp:TextBox ID="txtPageName" runat="server" CssClass="input-xlarge"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvPageName" runat="server" CssClass="alert-error"
                ErrorMessage="Please enter page name" ControlToValidate="txtPageName" ValidationGroup="Content"
                Display="Dynamic"></asp:RequiredFieldValidator>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">
            Page Keywords</label>
        <div class="controls">
            <asp:TextBox ID="txtKeywords" runat="server" CssClass="input-xxlarge"></asp:TextBox>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">
            Page Description</label>
        <div class="controls">
            <asp:TextBox ID="txtDescription" runat="server" CssClass="input-xxlarge"></asp:TextBox>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label">
            Page Content</label>
        <div class="controls">
            <textarea class="cleditor" id="txtPageContent" rows="3" runat="server"></textarea>
        </div>
    </div>
    <div class="form-actions">
        <asp:Button ID="btnSubmit" runat="server" CssClass="btn btn-primary" Text="Submit"
            ValidationGroup="Content" OnClick="btnSubmit_Click" />
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btn" OnClick="btnCancel_Click" />
    </div>
</asp:Content>
